{*include file='share/head.html'*}
<link rel="stylesheet" type="text/css" href="static/pubilc/bootstrap/css/bootstrap-select.css"/>

{*include file='admin/header.html'*}
	<!--内容-->
	
	
	<div class="IC-card">
		<div class="container">
			<div class="IC-content" >
				<!--内容-->
				<div  class="" >
					<table class="table table-striped">
						<caption>
							厂牌型号信息
							<button class="btn btn-primary pull-right" data-toggle="modal" data-target="#myModal">新增</button>
						</caption>
						<thead>
		                    <tr>
		                        <th>编号</th>
		                        <th>生产厂家</th>
		                        <th>厂牌型号</th>
		                        <th>车长</th>
		                        <th>车宽</th>
		                        <th>车高</th>
		                        <th>燃料</th>
		                        <th>吨位</th>
		                        <th>座位</th>
		                        <th>操作	</th>
		                    </tr>
	                    </thead>
	                    <tbody>
	                    	{*foreach $data as $value*}
	                    	<tr id="{*$value.id*}">
								<th>{*$value.id*}</th>
								<th>{*$value.vehicleModelTypeName*}</th>
								<th>{*$value.vehicleModel*}</th>
								<th>{*$value.length*}</th>
								<th>{*$value.width*}</th>
								<th>{*$value.height*}</th>
								<th>{*$value.oilType*}</th>
								<th class="hidden"></th>
								<th>{*$value.capacity*}</th>
								<th>{*$value.passenger*}</th>
								<td>
									<a href="#" class="text-primary" data-toggle="modal" data-target="#myModal">修改</a>&ensp;|
									<a href="admin.php?c=admin&mcarlabeldel&labelid={*$value.id*}" class="text-danger">删除</a>
								</td>
							</tr>
							{*/foreach*}
	                    </tbody>
		            </table id='brand_table_data'>
					<div class="page text-center">
						<ul class="pagination pagination-lg">
							{*if $pages.page!=1*}
							<li><a href="index.php?c=index&m=index&page=1">&laquo;</a></li>
							<li><a href="index.php?c=index&m=index&page={*$pages.page-1*}">&lt;</a></li>
							{*/if*}
							{*for $page=1 to $pages.count*}
							<li class="{*if $pages.page==$page*}active{*/if*}">
								<a href="index.php?c=index&m=index&page={*$page*}">{*$page*}</a></li>
							{*/for*}
							{*if $pages.page!=$pages.count||$pages.page>1*}
							<li><a href="index.php?c=index&m=index&page={*$pages.page+1*}">&gt;</a></li>
							<li><a href="index.php?c=index&m=index&page={*$pages.count*}">&raquo;</a></li>
							{*/if*}
						</ul>
					</div>
				</div>		

				<!--提交-->
			<div class="modal fade container" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			    <div class="modal-dialog ">
			        <div class="modal-content ">
			        	<form  class="bs-example bs-example-form" method="post" action="admin.php?c=admin&m=brand">
			            <div class="modal-header">
			                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			                <h4 class="modal-title" id="myModalLabel">厂牌型号修改</h4>
			            </div>
			            <div class="modal-body clearfix">
				        	<input type="hidden" name="carlabelid" value="">
		            		<div class=" col-xs-6 mt">
		            			<div class="input-group ">
									<span class="input-group-addon">生产厂家:</span>
									<select class="selectpicker"  name="vehicleModelTypeName">
									  {*foreach $carconf.vehicleManufacturer as $value*}	
				                      <option value="{*$value*}">{*$value*}</option>
				                      {*/foreach*}
									</select>
								</div>
							</div>
							<div class=" col-xs-6 mt">
								<div class="input-group ">
									<span class="input-group-addon">厂牌型号:</span>
									<input type="text" class="form-control valid" name="vehicleModel" placeholder="2400">
								</div>
							</div>
							
							<div class=" col-xs-6 mt">
								<div class="input-group ">
									<span class="input-group-addon">长（毫米）:</span>
									<input type="text" class="form-control valid" name="length" placeholder="2400">
								</div>
							</div>
							<div class=" col-xs-6 mt">
		            			<div class="input-group ">
									<span class="input-group-addon">宽（毫米）:</span>
									<input type="text" class="form-control" name="width" placeholder="6620">
								</div>
							</div>
							<div class=" col-xs-6 mt">
								<div class="input-group ">
									<span class="input-group-addon">高（毫米）:</span>
									<input type="text" class="form-control valid" name="height" placeholder="2400">
								</div>
							</div>
							<div class=" col-xs-6 mt">
		            			<div class="input-group ">
									<span class="input-group-addon">燃料:</span>
									<select class="selectpicker"  name="oilType">
									  {*foreach $carconf.vehicleOilType as $value*}	
				                      <option value="{*$value*}">{*$value*}</option>
				                      {*/foreach*}
									</select>
								</div>
							</div>
							<div class="col-xs-6 mt">
								<div class="input-group ">
									<span class="input-group-addon">吨位:</span>
									<input type="text" class="form-control valid" name="capacity" placeholder="2400">
								</div>
							</div>
							<div class=" col-xs-6 mt">
		            			<div class="input-group ">
									<span class="input-group-addon">座位:</span>
									<input type="text" class="form-control" name="passenger" placeholder="6620">
								</div>
							</div>
			            </div>
			            <div class="modal-footer">
			                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			                <input class="btn btn-success" type="submit" value="提交"/>
			            </div>
			            </form>
			        </div><!-- /.modal-content -->
			    </div><!-- /.modal -->
			    
			</div>
				
			</div>
			
			<script src="static/pubilc/bootstrap/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
			<script src="static/pubilc/bootstrap/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
			<script src="static/pubilc/bootstrap/js/bootstrap-select.min.js" type="text/javascript" charset="utf-8"></script>
			<script type="text/javascript">
				$(function(){
					$("#brand_table_data tr").click(function () {
			            $("#brand_table_data tr").removeClass("info");
			            $(this).addClass("info");
			            $("#select-brand").val($(this).prop("id"));
			        });
					
					//清空选项卡
					$('.table-striped button.btn-primary').click(function(){
				    	for (var i=0;i<9;i++) {
				    		$('.clearfix .form-control').eq(i).val( '' )
				    	}
					})
					//添加选项卡
					$('.table-striped ').delegate('a.text-primary',{
						click:function(){
					    	var th = $(this).parents('tr').find('th');
					    	for (var i=1;i<th.length;i++) {
					    		$('.clearfix .form-control').eq(i-1).val( th.eq(i).text() )
					    	}
					    	
					    	$('.selectpicker').selectpicker('val',  th.eq(6).text() )
					    	$('.clearfix  input[type="hidden"]').val( $(this).parents('tr').attr('id') )
						}
					})
				})
			</script>
		</div>	
	</div>
{*include file='share/footer.html'*}